#!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.urls import path
from django.views.decorators.csrf import csrf_exempt
from rest_framework.routers import SimpleRouter

from .views import (VehicleInfoModelViewSet, VehicleFaultInfoModelViewSet, VehicleInfoRealDataView, VehicleFaultLogModelViewSet, 
                    VehicleFenceModelViewSet, VehicleMoveInfoModelViewSet, VehicleMovePathStartView, VehicleInfoHistoryDataView, 
                    VehicleInfoIndexDataView)

router = SimpleRouter()
router.register("api/vehicle", VehicleInfoModelViewSet)
router.register("api/vehicle_move", VehicleMoveInfoModelViewSet)
router.register("api/vehicle_fault", VehicleFaultInfoModelViewSet)
router.register("api/vehicle_fault_log", VehicleFaultLogModelViewSet)
router.register("api/vehicle_fence", VehicleFenceModelViewSet)

urlpatterns = [
    path('api/vehicle_info/real_data/<str:vin>', VehicleInfoRealDataView.as_view()),
    path('api/vehicle_info/history_data/<str:vin>', VehicleInfoHistoryDataView.as_view()),
    path('api/vehicle_info/index_data/', VehicleInfoIndexDataView.as_view()),
    path('api/vehicle_move_path/start/', VehicleMovePathStartView.as_view()),
    path('api/vehicle_fence/', VehicleFenceModelViewSet.as_view({'get': 'list'})),
    path('api/vehicle_move/', VehicleMoveInfoModelViewSet.as_view({'get': 'list'})),
    path('api/vehicle/', VehicleInfoModelViewSet.as_view({'get': 'list'})),
]
urlpatterns += router.urls
